<template>
  <div>
    <h1>申请 HTTPS 证书 : {{ domain }}</h1>

    <div>
      <el-button type="success" @click="handleClickRequest">
        提交申请
      </el-button>
    </div>

    <el-dialog v-model="displayDialogWorking" title="正在提交申请">
      <div>请稍候 ...</div>
    </el-dialog>

    <el-dialog v-model="displayDialogVerify" title="验证域名所有权">
      <div>
        <el-button type="success" @click="handleClickVerify"> 验证 </el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "certificates-view-csr",

  computed: {
    domain() {
      return this.$route.params["domain"];
    },
  },

  data() {
    return {
      displayDialogWorking: false,
      displayDialogVerify: false,
    };
  },

  methods: {
    handleClickVerify() {},

    handleClickRequest() {
      let vo = {};
      let config = {
        method: "POST",
        url: "/api/v1/csr",
        data: vo,
      };
      this.$store.dispatch("axios/send", config);
    },
  },
};
</script>
